<%-- 
    Document   : doCancelReserve
    Created on : Dec 19, 2012, 2:27:13 PM
    Author     : alexxxey
--%>

<%@page import="java.util.StringTokenizer"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Booking Tickets Web Appliaction</title>
    </head>
    <body>
        <%@page import="javax.naming.*, bookingtickets.*" %>        
        <%!
            BookingTicketsSessionRemote ejbRef = null;               
        %>
        <%
            InitialContext ic = new InitialContext();
            ejbRef = (BookingTicketsSessionRemote)ic.lookup("bookingtickets.BookingTicketsSessionRemote");
        %>
        
        <h3>Отмена резервирования</h3>
        
        <%
            if (request.getParameterValues("tickets") != null)
            {
                String[] ticketsStr = request.getParameterValues("tickets");
                                
                for (int i=0; i<ticketsStr.length; ++i)                    
                {
                    String[] result = ticketsStr[i].split(",");   
                    ejbRef.cancelReserve(new Integer(result[0]), 
                            new Integer(result[1]));
                }
            }
            
            %><h4>Резервирование отменено!</h4><%
        %>
        
        <p><a href="findReservedTickets.jsp">Зарезервированные билеты</a></p>
        <p><a href="index.jsp">Главная страница</a></p>
    </body>
</html>
